<template>
  <div class="app">
    <h1>我是App组件(祖)</h1>
    <!-- <Child /> -->
    <Suspense>
      <template v-slot:default>
        <Child />
      </template>
      <template v-slot:fallback>
        <h3>请稍等...</h3>
      </template>
    </Suspense>
  </div>
</template>

<script>
// import Child from "./components/Child"   //静态引入

import { defineAsyncComponent } from "vue";
const Child = defineAsyncComponent(() => import("./components/Child"));
export default {
  name: "App",
  components: {
    Child
  }
};
</script>

<style>
.app {
  background-color: gray;
  padding: 10px;
}
</style>